/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.fjut.sel1602.csp.util;

import edu.fjut.sel1602.csp.Dao.AccountDao;
import edu.fjut.sel1602.csp.Dao.PetDao;
import edu.fjut.sel1602.csp.Dao.PetOwnerDao;
import edu.fjut.sel1602.csp.Dao.PetStoreDao;
import edu.fjut.sel1602.csp.Dao.impl.AccountDaoImpl;
import edu.fjut.sel1602.csp.Dao.impl.PetDaoOracleImpl;
import edu.fjut.sel1602.csp.Dao.impl.PetOwnerDaoOracleImpl;
import edu.fjut.sel1602.csp.Dao.impl.PetStoreDaoOracleImpl;
import edu.fjut.sel1602.csp.entity.Pet;
import edu.fjut.sel1602.csp.entity.PetOwner;
import edu.fjut.sel1602.csp.entity.PetStore;
import edu.fjut.sel1602.csp.service.PetOwnerService;
import edu.fjut.sel1602.csp.service.PetStoreService;
import edu.fjut.sel1602.csp.service.impl.PetOwnerServiceImpl;
import edu.fjut.sel1602.csp.service.impl.PetStoreServiceImpl;
import java.security.acl.Owner;
import java.util.List;
import java.util.Scanner;
import java.util.function.Function;
import static jdk.nashorn.tools.ShellFunctions.input;

/**
 *
 * @author lenovo
 */
public class Client {
    
   
    public static void main(String[] args){  
        
        PetDao pet =new PetDaoOracleImpl();
        PetOwnerDao owner=new PetOwnerDaoOracleImpl();
        PetStoreDao store=new PetStoreDaoOracleImpl();
        AccountDao account =new AccountDaoImpl();
        PetOwner po=new PetOwner();
        PetOwnerService pos=new PetOwnerServiceImpl();
        PetStore ps=new PetStore();
        PetStoreService pss=new PetStoreServiceImpl();
        Scanner input =new Scanner(System.in);
        List<String> list1,list2,list3;
        list1=pet.getPetName();
        list2=owner.getOwnerName();
        list3=store.getStoreName();
        System.out.println("宠物商店启动");
        System.out.println("Wonderland醒来,所有宠物从oracle中醒来");
        System.out.println("**********************************************");
        for(int i=0;i<list1.size();i++)
        {
            System.out.println("第"+(i+1)+"个宠物，名字叫："+list1.get(i));
        }
        System.out.println("**********************************************");
        System.out.println("所有宠物主人从oracle中醒来");
        System.out.println("**********************************************");
        for(int i=0;i<list2.size();i++)
        {
            System.out.println("第"+(i+1)+"个宠物主人，名字叫："+list2.get(i));
        }
        System.out.println("**********************************************");
        System.out.println("所有宠物商店从oracle中醒来");
        System.out.println("**********************************************");
        for(int i=0;i<list3.size();i++)
        {
            System.out.println("第"+(i+1)+"个宠物商店，名字叫："+list3.get(i));
        }
        System.out.println("**********************************************");
        System.out.println("请选择输入登录模式，输入1为宠物主人登录，输入2为宠物商店登录");
        int isLogin=input.nextInt();
        if(isLogin==1)
        {
            pos.login();
            
        }
        else if(isLogin==2)
        {
            pss.login();
        }
    }		  
} 			